import request from '@/config/axios'
import type { HMemberType } from './types'

export const getMemberTypesListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/hmember-types', params })
}

export const createMemberTypesApi = (data: Partial<HMemberType>): Promise<IResponse> => {
  return request.post({ url: '/hmember-types', data })
}

export const updateMemberTypesApi = (
  id: string,
  data: Partial<HMemberType>
): Promise<IResponse> => {
  return request.put({ url: `/hmember-types/id/${id}`, data })
}

export const getMemberTypesDetailApi = (id: string): Promise<IResponse<HMemberType>> => {
  return request.get({ url: `/hmember-types/id/${id}` })
}

export const delMemberTypesListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/hmember-types/id/${ids[0]}` })
}
